function getPW(){
var numbers='0123456789';
var lowercase='abcdefghijklmnopqrstuvwxyz';
var uppercase='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var symbols='!@#$%^&*()_+*/?~,.:;'

var number_flag=confirm("Do you want numbers?");
var lower_flag=confirm("Do you want lowercase letters?");
var upper_flag=confirm("Do you want uppercase letters?");
var symbols_flag=confirm("Do you want to use symbols");
	
while (number_flag==false && lower_flag==false && upper_flag==false){
		number_flag=confirm("Do you want numbers?");
		lower_flag=confirm("Do you want lowercase letters?");
		upper_flag=confirm("Do you want uppercase letters?");
		symbols_flag=confirm("Do you want to use symbols");
	} 

var PW_Length=prompt('Enter the length of you password (limit between 7 and 20 characters)');
while (isNaN(PW_Length)){
	PW_Length=prompt('Enter the length of you password (limit between 7 and 20 characters)');
	}
while (PW_Length<7){
	PW_Length=prompt('Enter the length of you password (limit between 7 and 20 characters)');
	}
while (PW_Length>20){
	PW_Length=prompt('Enter the length of you password (limit between 7 and 20 characters)');
	}	
var possible_chars="";

if(number_flag){
	possible_chars+=numbers;
	}
if (lower_flag){
	possible_chars+=lowercase;
	}
if (upper_flag){
	possible_chars+=uppercase;
	}
if (symbols_flag){
	possible_chars+=symbols;
	}

var y= possible_chars.length;
var password=[];
var i=0;

while (i<PW_Length){
	password[i]=possible_chars.charAt(Math.floor(Math.random()*y));
	i++;
	}

	password=password.join("");
	alert (password);
}